<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>居中</title>
		<style type="text/css">
			.box1 {
				width: 600px;
				height: 400px;
				border: 1px solid #000000;
			}
			.box2 {
				width: 200px;
				height: 100px;
				border: 1px solid purple;
				margin: 150px auto;
				
			}
		</style>
	</head>
	<body>
		<div class="box1">
			<div class="box2"></div>
		</div>
	</body>
</html>
